package com.test.pattern.decorator;

/**
 * @ClassName: Egg
 * @description: 鸡蛋类(具体装饰者类)
 * @author: Mr du
 * @create: 2024-02-21 22:16
 */
public class Egg extends Garnish{

    public Egg(FastFood fastFood){
        super(fastFood, 1, "鸡蛋");
    }

    @Override
    public float cost() {
        //计算价格
        return getPrice() + getFastFood().cost();
    }

    @Override
    public String getDesc() {
        return super.getDesc()+getFastFood().getDesc();
    }
}
